//
//  PicTableViewCell.m
//  chanyou
//
//  Created by 高爽 on 15-1-4.
//  Copyright (c) 2015年 wanli. All rights reserved.
//

#import "PicTableViewCell.h"

#import "Masonry.h"

#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)


@implementation PicTableViewCell
- (void)dealloc
{
    [_groupPic release];
    [_content release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
            self.groupPic = [[UIImageView alloc] init];
            [self.contentView addSubview:_groupPic];
            [_groupPic release];
            
            self.content = [[UILabel alloc] init];
            _content.font = [UIFont systemFontOfSize:15.0];
            _content.numberOfLines = 0;
            [self.contentView addSubview:_content];
            [_content release];
        }return self;
    }

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [_groupPic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(5);
        make.top.equalTo(self.contentView.mas_top).offset(5);
        
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH - 10, SCREEN_HEIGHT / 3));
    }];
    
    [_content mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.left.bottom.right.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(SCREEN_HEIGHT / 3 + 10, 10, 10, 10));
        
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH - 10, 100));
    }];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
